package com.ruoyi.summarize.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.summarize.model.SummarizeChecked;
import com.ruoyi.summarize.model.Summarize;
import com.ruoyi.summarize.service.ISummarizeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/summarize")
public class SummarizeController {
    @Autowired
    private ISummarizeService summarizeService;

    @GetMapping(value = "/{pid}")
    public AjaxResult listSummarize(@PathVariable("pid") Long pid){
        return AjaxResult.success(summarizeService.listSummarize(pid));
    }
    @PostMapping
    public AjaxResult insertSummarize(@RequestBody Summarize summarize){
        summarizeService.updateSummarize(summarize);
        return AjaxResult.success();
    }
    @GetMapping("/finish/{pid}")
    public AjaxResult isFinish(@PathVariable("pid")Long pid){
        return AjaxResult.success(summarizeService.checkFinish(pid));
    }
}

